<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改村民信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-clientUser-edit" th:object="${clientUser}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="villageId" th:field="*{villageId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户主：</label>
                <div class="col-sm-8">
                    <input name="masterName" th:field="*{masterName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户主电话：</label>
                <div class="col-sm-8">
                    <input maxlength="11" name="masterPhoneNumber" th:field="*{masterPhoneNumber}" class="form-control number" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">身份证号：</label>
                <div class="col-sm-8">
                    <input maxlength="18" name="masterIdentityCardNumber" th:field="*{masterIdentityCardNumber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">取暖方式： </label>
                <div class="col-sm-8">
                    <select name="keepwarmType" class="form-control m-b" th:with="type=${@dict.getType('keep_warm_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{keepwarmType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否配有型煤专用炉具：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
                        <input type="radio" th:id="${'stove_' + dict.dictCode}" name="stove" th:value="${dict.dictValue}" th:field="*{stove}" required>
                        <label th:for="${'stove_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否安装一氧化碳报警器：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
                        <input type="radio" th:id="${'alarm_' + dict.dictCode}" name="alarm" th:value="${dict.dictValue}" th:field="*{alarm}" required>
                        <label th:for="${'alarm_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否进行广播媒体宣传：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
                        <input type="radio" th:id="${'media_' + dict.dictCode}" name="media" th:value="${dict.dictValue}" th:field="*{media}" required>
                        <label th:for="${'media_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否发放明白纸：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}">
                        <input type="radio" th:id="${'note_' + dict.dictCode}" name="note" th:value="${dict.dictValue}" th:field="*{note}" required>
                        <label th:for="${'note_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">取暖面积：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('keep_warn_area')}">
                        <input type="radio"  th:id="${'area_' + dict.dictCode}" name="area" th:value="${dict.dictValue}" th:field="*{area}" required>
                        <label th:for="${'area_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">户内人口：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="population" th:field="*{population}" class="form-control number" type="number" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">二维码：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="qrCode" th:field="*{qrCode}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label" is-required>包联人：</label>
                <div class="col-sm-8">
                    <input name="baolianrenId" type="hidden" th:field="*{baolianren.id}">
                    <input name="baolianrenName" th:field="*{baolianren.name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">包联人联系电话：</label>
                <div class="col-sm-8">
                    <input maxlength="11" name="baolianrenPhone" th:field="*{baolianren.phone}" class="form-control number" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">网格员：</label>
                <div class="col-sm-8">
                    <input name="gridName" th:field="*{gridName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">本户是否在辖区内</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="radio" th:field="*{isIn}" th:id="isIn_1" name="isIn" th:value="1" required>
                        <label th:text="是"></label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" th:field="*{isIn}" th:id="isIn_0" name="isIn" th:value="0" required>
                        <label th:text="否"></label>
                    </div>
                </div>
            </div>
        </form>
        <div class="box-footer">
            <div class="col-sm-offset-5 col-sm-10">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
<!--                <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>-->
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "jjm/clientUser";
        $("#form-clientUser-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-clientUser-edit').serialize());
            }
        }
    </script>
</body>
</html>